#!/usr/bin/python
# -*- coding: UTF-8 -*-
from UtilPackge import readExcel
from UtilPackge import Logger
import time

def writeProductCountAndPrice(browser,filePath):
    #写入数量
    writeCounts(browser)

    #写入价格
    writeProductPrice(browser,filePath)

def writeProductPrice(browser,filePath):
    sheetName = 'ColorTypeData'
    DataExcel = readExcel.readExceInfo(filePath,sheetName)
    Logger.logger.info("获取到Sheet页面ColorTypeData的数据为："+str(DataExcel))
    for item in range(len(DataExcel)):

        browser.find_element_by_xpath \
            ('//*[@id="struct-sku"]/div/div[2]/div[1]/div/div/div[2]/div/div[2]/div/table/tbody/tr['
             +str(int(item)+1)+']/td[2]/div/span/span/span/input').send_keys(str(DataExcel.get(item)[1]))
1
def writeCounts(browser):
    browser.find_element_by_xpath \
        ('//*[@id="struct-sku"]/div/div[2]/div[1]/div/div/div[2]/div/div[1]'
         '/div/div/div[3]/div/div/div/div/span/span/span/input').send_keys(50)
    browser.find_element_by_xpath \
        ('//*[@id="struct-sku"]/div/div[2]/div[1]/div/div/div[1]/button').click()